<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>展开语法操作dom节点元素</title>
</head>
<body>
    <div>klsnflksdf</div>
    <div>3623565464</div>
    <script>
        let divs = document.querySelectorAll('div');
        console.log(divs);

        // 将dom节点转化为数组
        // Array.from(divs).map(function(item){
        //     console.log(item);
        // });

        // Array.prototype.map.call(divs,function(item){
        //     console.log(item);
        // })

        [...divs].map(function(item){
            item.addEventListener('click',function(){
                console.log('jhdsfbkjsdfb');
            })
        })
    </script>
</body>
</html>